<template>
  <div class="control-item">
    <div class="control-header">
      <span class="control-name">模块标题</span>
    </div>
    <div class="control-body">
      <div class="control-section">
        <!-- 字体配置 -->
        <fontControl
          controlName="标题文字"
          :fontData="params.params.moduleNameCss"
          :showAlign="false"
          @resetFontCss="resetModuleNameCss"
        ></fontControl>
        <!-- 字体配置 -->
        <fontControl
          controlName="更多文字"
          :fontData="params.params.moduleMoreCss"
          :showAlign="false"
          @resetFontCss="resetModuleMoreCss"
        ></fontControl>
      </div>
    </div>
  </div>
</template>

<script>
import fontControl from "@/components/DiyNew/diy/baseControl/fontControl/index.vue";

export default {
  name: "editModuleHeader",
  components: {
    fontControl,
  },
  props: {
    params: {
      type: Object,
      default: {},
    },
  },
  data() {
    return {};
  },
  watch: {},
  computed: {},
  methods: {
    // 重置字体样式
    resetModuleNameCss() {
      let style = Object.assign({}, pageHeader.params.moduleNameCss);
      this.$set(this.params.params, "moduleNameCss", style);
    },
    resetModuleMoreCss() {
      let style = Object.assign({}, pageHeader.params.moduleMoreCss);
      this.$set(this.params.params, "moduleMoreCss", style);
    },
  },
};
</script>

<style lang="scss" scoped>
.control-item {
  width: 100%;
  height: 100%;
  margin: 0 auto;
  .control-header {
    width: 100%;
    height: 48px;
    background: #ffffff;
    border-bottom: 1px solid #f0f2f5;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px 14px 24px;
    span {
      font-size: 12px;
      color: #8c8c8c;
    }
    .control-name {
      font-size: 14px;
      font-weight: 600;
      color: #000000;
    }
  }
  .control-body {
    width: 100%;
    .control-section {
      width: 228px;
      margin: 0 auto;
      text-align: center;
    }
  }
}
</style>
